package com.yzg.park;

import java.util.concurrent.locks.LockSupport;

/**
 * @author misterWei
 * @create 2020年05月05号:17点00分
 * @mailbox forcontinue@163.com
 */
public class ParkRemin {

    public static void main(String[] args) throws InterruptedException {

        Thread thread = new Thread(() -> {
            // 对当前 this 进行沉睡
            System.out.println("t1");
            LockSupport.park();
            System.out.println("t1");

        }, "t1");

        thread.start();
        //LockSupport.unpark(thread);
        Thread.sleep(2000L);
        //唤醒某个线程
        LockSupport.unpark(thread);
    }
}
